class CreateFolderContents < ActiveRecord::Migration
  def self.up
    create_table :folder_contents do |t|
      t.integer :sub_folder_id
      t.integer :seq

      t.timestamps
    end

    define_foreign_key_column :folder_contents, :sub_folder_id, :folder_contents 
    add_foreign_key :folder_contents, :folders 
    add_foreign_key :folder_contents, :pages 
    add_foreign_key :folder_contents, :functions 
  end

  def self.down
    remove_foreign_key :folder_contents, :sub_folder_id 
    remove_foreign_key :folder_contents, :folders 
    remove_foreign_key :folder_contents, :pages 
    remove_foreign_key :folder_contents, :functions 
    drop_table :folder_contents
  end
end
